package com.ruoyi.web.service.impl;

import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.web.domain.GxtNotice;
import com.ruoyi.web.domain.GxtNoticeFile;
import com.ruoyi.web.domain.dto.GxtNoticeQueryDto;
import com.ruoyi.web.domain.vo.GxtNoticeVo;
import com.ruoyi.web.mapper.GxtNoticeFileMapper;
import com.ruoyi.web.mapper.GxtNoticeMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * description:
 * auth fcb
 * date 2025-11-01 17:36
 **/
@Service
@Slf4j
public class GxtNoticeService extends ServiceImpl<GxtNoticeMapper, GxtNotice> {

    @Autowired
    private GxtNoticeJsoupService gxtNoticeJsoupService;
    @Autowired
    private GxtNoticeFileMapper gxtNoticeFileMapper;

    /**
     * 查询公告列表
     * @param queryDto
     * @return
     */
    public List<GxtNoticeVo> queryGxtNoticeList(GxtNoticeQueryDto queryDto) {
        return baseMapper.queryGxtNoticeList(queryDto);
    }

    /**
     * 根据id查询公告信息
     * @param baseId
     * @return
     */
    public GxtNoticeVo queryGxtNoticeById(String baseId) {
        GxtNoticeVo gxtNoticeVo = baseMapper.queryGxtNoticeById(baseId);
        gxtNoticeVo.setFileList(new ArrayList<>());
        return gxtNoticeVo;
    }

    public void getGxtNotice(String type, String pageNum) {
        gxtNoticeJsoupService.jsoupGxtNotice(type, pageNum);
    }


}
